{% extends "buyer/base.html" %}
{% block title %}
    天天生鲜——首页
{% endblock %}
{% block ys %}
    <div class="container">
<!--首页头部搜索栏导航-->
<header class="container">
    <div class="col-xs-12 col-sm-3">
        <img src="/static/buyer/images/logo.png"/>
    </div>
    <div class="col-xs-12 col-sm-6 makepos">
        <div class="input-group">
            <input type="text" class="form-control" placeholder="搜索商品">
            <span class="input-group-btn">
                    <button class="btn btn-success" type="button">搜&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;索</button>
                </span>
        </div><!-- /input-group -->
    </div>
    <div class="col-xs-12 col-sm-3">
        <button class="btn btn-success pull-right" type="button">
            <img src="/static/buyer/images/cart.png"/>我的购物车 <span class="badge">4</span>
        </button>
    </div>
</header>
{% endblock %}
{% block content %}
    <menu class="container">
    <div class="col-xs-12 col-sm-2">
        <ul class="list-group">
            <li class="list-group-item active">全部商品分类</li>
            <li class="list-group-item"><a href="#fruit"><img src="/static/buyer/images/fruit.png"/>新鲜水果&nbsp;&nbsp;></a></li>
            <li class="list-group-item"><a href="#haixian"><img src="/static/buyer/images/haixian.png"/>海鲜水产&nbsp;&nbsp;></a></li>
            <li class="list-group-item"><a href="#pig"><img src="/static/buyer/images/pig.png"/>猪牛羊肉&nbsp;&nbsp;></a></li>
            <li class="list-group-item"><a href="#egg"><img src="/static/buyer/images/egg.png"/>禽类蛋品&nbsp;&nbsp;></a></li>
            <li class="list-group-item"><a href="#vegetable"><img src="/static/buyer/images/vegetable.png"/>新鲜蔬菜&nbsp;&nbsp;></a></li>
            <li class="list-group-item"><a href="#frozen"><img src="/static/buyer/images/frozen.png"/>速冻食品&nbsp;&nbsp;></a></li>
        </ul>
    </div>
    <div class="col-xs-12 col-sm-10">
        <ul class="nav nav-tabs">
            <li role="presentation" class="active"><a href="index.html">首页</a></li>
            <li role="presentation"><a href="#">手机生鲜</a></li>
            <li role="presentation"><a href="#">抽奖</a></li>
        </ul>
        <div class="col-xs-12 col-sm-9">
            <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
                <!-- Indicators -->
                <ol class="carousel-indicators">
                    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
                    <li data-target="#carousel-example-generic" data-slide-to="3"></li>
                </ol>
                <!-- Wrapper for slides -->
                <div class="carousel-inner" role="listbox">
                    <div class="item active">
                        <img src="/static/buyer/images/slide.jpg">
                    </div>
                    <div class="item">
                        <img src="/static/buyer/images/slide02.jpg">
                    </div>
                    <div class="item">
                        <img src="/static/buyer/images/slide03.jpg">
                    </div>
                    <div class="item">
                        <img src="/static/buyer/images/slide04.jpg">
                    </div>
                </div>

                <!-- Controls -->
                <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                </a>
                <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                </a>
            </div>
        </div>
        <div class="col-xs-12 col-sm-3">
            <img src="/static/buyer/images/adv01.jpg" class="mypic"/>
            <img src="/static/buyer/images/adv02.jpg" class="mypic"/>
        </div>
    </div>
</menu>
<!--商品分类列表水平栏-->
{% for one in data %}
    {% for key,value in one.items %}
    <section class="container" id="fruit">
    <div class="panel panel-success">
        <div class="panel-heading">{{ key.t_name }}
            <div class="pull-right"><a href="/buyer/list/?t_id={{ key.id }}">查看更多...</a></div>
        </div>
        <div class="panel-body">
            <div class="col-xs-12 col-sm-2">
                <img src="/static/buyer/{{ key.t_img }}" class="img-responsive">
            </div>
            {% for g in value %}
            <div class="col-xs-12 col-sm-2">
                <a href="/buyer/detail/{{ g.id }}/" class="thumbnail">
                    <p class="text-center">{{ g.g_name }}</p><br/>
                    <img src="/static/buyer/{{ g.g_picutre }}" class="img-responsive">
                    <p class="text-center">¥{{ g.g_price }}元</p>
                </a>
            </div>
                {% endfor %}
        </div>
    </div>
</section>
    {% endfor %}
{% endfor %}

    </div>
{% endblock %}